package com.ntschy.bt.entity.enums;


import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 *
 * @author lxr
 *
 * 类别
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BtHelpTypeEnum implements IEnum<Integer>{


    /**
     * 类别 1区级求助 2市级求助
     */
    MUNICIPAL_HELP(0, "区级求助"),
    DISTRICT_LEVEL_HELP(1,"市级求助");


//    @JsonValue
    private final int value;

//    @JsonValue
    private final String desc;

    BtHelpTypeEnum(int value,String desc){
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }


    @JsonCreator
    public static BtHelpTypeEnum BtHelpBackFromValue(int value){
        for (BtHelpTypeEnum examineResult : BtHelpTypeEnum.values()){
            if(examineResult.getValue() == value){
                return examineResult;
            }
        }

        return  null;
    }


}
